﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CrounchGear : MonoBehaviour
{
    private void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.gameObject.layer == PhysicsLayer.Board)
        {
            GameManager.GetInstance().Player1.OnlyCanCrouch = true;
            GameManager.GetInstance().Player2.OnlyCanCrouch = true;
            GameManager.GetInstance().Player1.MyRigidBody.velocity = Vector2.zero;
            GameManager.GetInstance().Player2.MyRigidBody.velocity = Vector2.zero;
        }
    }
    private void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.gameObject.layer == PhysicsLayer.Board)
        {
            GameManager.GetInstance().Player1.OnlyCanCrouch = false;
            GameManager.GetInstance().Player2.OnlyCanCrouch = false;
        }
    }
}
